package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysRolePerm;
import com.school.manager.entity.po.SysRolePermPo;
import com.school.manager.entity.vo.SysRolePermVo;
import com.school.manager.mapper.SysRolePermMapper;
import com.school.manager.service.ISysRolePermService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：角色权限关联业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysRolePermMapperImpl extends ServiceImpl<SysRolePermMapper, SysRolePerm> implements ISysRolePermService {
	
	@Autowired
    private SysRolePermMapper sysRolePermMapper;
	
	@Override
	public Page<SysRolePermVo> page(SysRolePermPo sysRolePermPo) {
		QueryWrapper<SysRolePerm> queryWrapper = PageUtil.buildQueryWrapper(sysRolePermPo, SysRolePerm.class);
        Page<SysRolePerm> page = new Page<>(sysRolePermPo.getCurrent(), sysRolePermPo.getSize());
        sysRolePermMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysRolePermVo.class);
	}
	

}
